package com.yfproject.models;


import java.io.Serializable;
import java.text.SimpleDateFormat;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;


@Entity
@Table(name="labels")
public class Labels implements Serializable{
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	private String name;
	
	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	private Long id;
	
	private int level;
	
	private int status;
	
	@Column(name="parent_id")
	private Long  parentId;
	
	private Date last_update_time=new Date(); 
	
	private String description;
	
	private String ex_1;
	
	private String ex_2;
	
	private String ex_3;

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public int getLevel() {
		return level;
	}

	public void setLevel(int level) {
		this.level = level;
	}

	public int getStatus() {
		return status;
	}

	public void setStatus(int status) {
		this.status = status;
	}

	public Long getParentId() {
		return parentId;
	}

	public void setParentId(Long parent_id) {
		this.parentId = parent_id;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public String getEx_1() {
		return ex_1;
	}

	public void setEx_1(String ex_1) {
		this.ex_1 = ex_1;
	}

	public String getEx_2() {
		return ex_2;
	}

	public void setEx_2(String ex_2) {
		this.ex_2 = ex_2;
	}

	public String getEx_3() {
		return ex_3;
	}

	public void setEx_3(String ex_3) {
		this.ex_3 = ex_3;
	}
	
	public String getLast_update_time() {
		SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
		return sdf.format(last_update_time);
	}
	
	public void setLast_update_time(java.sql.Timestamp last_update_time) {
		this.last_update_time = last_update_time;
	}

	@Override
	public String toString() {
		return "Labels [name=" + name + ", id=" + id + ", level=" + level + ", status=" + status + ", parentId="
				+ parentId + ", last_update_time=" + last_update_time + ", description=" + description + ", ex_1="
				+ ex_1 + ", ex_2=" + ex_2 + ", ex_3=" + ex_3 + "]";
	}
		
}
